package org.jground.rx.ui.zk;

import org.jground.rx.IRXObject;
import org.jground.rx.ui.IMainPanel;
import org.zkoss.zk.ui.Component;

public class UIViewWindowDelegator implements IMainPanel<Component> {

    private UIViewWindow viewWindow;
    private IRXObject mod;

    public UIViewWindowDelegator(UIViewWindow viewWindow, IRXObject mod) {
        this.viewWindow = viewWindow;
        this.mod = mod;

    }

    // public UIViewWindowDelegator(UIFrame uiFrame, String oid) {
    // this.mod= IRXObject.GetById(oid);
    // this.viewWindow = uiFrame.GetViewWindow(mod.GetMoid());

    // }

    public void beforeShow() {
        // viewWindow.clearData();
        viewWindow.setData(mod);

    }

    public void beforeClose() {
        viewWindow.clearData();
    }

    public Component getView() {
        return viewWindow;
    }

}
